package cn.xu.bookstore.book.service;

import java.util.List;

import cn.xu.bookstore.book.dao.BookDao;
import cn.xu.bookstore.book.domain.Book;

public class BookService {

	private BookDao bookDao = new BookDao();
	
	public List<Book> findAll(){
		return bookDao.findAll();
	}
	
	public List<Book> findbyCategory(String cid){
		return bookDao.findByCategory(cid);
	}

	public Book load(String bid) {
		
		return bookDao.findByBid(bid);
	}

	public void edit(Book book) {
		
		 bookDao.updateBook(book);
		
	}

	/*
	 * 并不是真正能的删除图书而是 改变图书的状态
	 */
	public void delete(String bid) {
		bookDao.delete(bid);
	}

	public void add(Book book) {
		bookDao.add(book);
		
	}
	
	
}
